package demo.jms.consumer;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * Created by alex on 15-5-13.
 */
public class MyConsumer implements MessageListener {


    @Override
    public void onMessage(Message message) {

        TextMessage textMessage = (TextMessage) message;
        System.out.println("receive message");
        try {
            System.out.println("message content  => " + textMessage.getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
